 package de.codi.structural;
//
// import de.codi.CODISettings;
// import com.googlecode.rockit.exception.ParseException;
// import com.googlecode.rockit.javaAPI.Model;
// import com.googlecode.rockit.javaAPI.formulas.FormulaCardinality;
// import com.googlecode.rockit.javaAPI.formulas.FormulaHard;
// import com.googlecode.rockit.javaAPI.formulas.FormulaObjective;
// import com.googlecode.rockit.javaAPI.formulas.FormulaSoft;
// import com.googlecode.rockit.javaAPI.formulas.expressions.impl.EqualVariableExpression;
// import com.googlecode.rockit.javaAPI.formulas.expressions.impl.PredicateExpression;
// import com.googlecode.rockit.javaAPI.formulas.variables.impl.VariableDouble;
// import com.googlecode.rockit.javaAPI.formulas.variables.impl.VariableType;
// import com.googlecode.rockit.javaAPI.predicates.Predicate;
// import com.googlecode.rockit.javaAPI.predicates.PredicateDouble;
// import com.googlecode.rockit.javaAPI.types.Type;
//
//
 public class ModelGenerator
 {
//
// public ModelGenerator()
// {
// }
//
//
// public Model generateModel()
// {
// Model model = new Model();
// try {
//
// Type tClass1 = new Type("Class1");
// Type tClass2 = new Type("Class2");
// Type tProp1 = new Type("Prop1");
// Type tProp2 = new Type("Prop2");
//
// // predicate cmap: Class1 x Class2;
// Predicate cmap = new Predicate(StructuralConstants.CMAP, true, tClass1, tClass2);
//
// // predicate pmap: Prop1 x Prop2;
// Predicate pmap = new Predicate(StructuralConstants.PMAP, true, tProp1, tProp2);
//
// // concepts hierarchy
// // predicate subsumes1: Class1 x Class1;
// Predicate subsumes1 = new Predicate(StructuralConstants.SUBSUMES + "1", false, tClass1, tClass1);
// // predicate subsumes2: Class2 x Class2;
// Predicate subsumes2 = new Predicate(StructuralConstants.SUBSUMES + "2", false, tClass2, tClass2);
//
// // disjointness between concepts
// // predicate disjoint1: Class1 x Class1;
// Predicate disjoint1 = new Predicate(StructuralConstants.DISJOINT + "1", false, tClass1, tClass1);
// // predicate disjoint2: Class2 x Class2;
// Predicate disjoint2 = new Predicate(StructuralConstants.DISJOINT + "2", false, tClass2, tClass2);
//
// // property domains in the concept hierarchy
// // predicate domainsub1: Prop1 x Class1;
// Predicate domainsub1 = new Predicate(StructuralConstants.DOMAINSUB + "1", false, tProp1, tClass1);
// // predicate domainsub2: Prop2 x Class2;
// Predicate domainsub2 = new Predicate(StructuralConstants.DOMAINSUB + "2", false, tProp2, tClass2);
//
// // predicate domainsup1: Prop1 x Class1;
// Predicate domainsup1 = new Predicate(StructuralConstants.DOMAINSUP + "1", false, tProp1, tClass1);
// // predicate domainsup2: Prop2 x Class2;
// Predicate domainsup2 = new Predicate(StructuralConstants.DOMAINSUP + "2", false, tProp2, tClass2);
//
// // disjointness between property domains and concept
// // predicate domaindis1: Prop1 x Class1;
// Predicate domaindis1 = new Predicate(StructuralConstants.DOMAINDIS + "1", false, tProp1, tClass1);
// // predicate domaindis2: Prop2 x Class2;
// Predicate domaindis2 = new Predicate(StructuralConstants.DOMAINDIS + "2", false, tProp2, tClass2);
//
// // property ranges in the concept hierarchy
// // predicate rangesub1: Prop1 x Class1;
// Predicate rangesub1 = new Predicate(StructuralConstants.RANGESUB + "1", false, tProp1, tClass1);
// // predicate rangesub2: Prop2 x Class2;
// Predicate rangesub2 = new Predicate(StructuralConstants.RANGESUB + "2", false, tProp2, tClass2);
//
// // predicate rangesup1: Prop1 x Class1;
// Predicate rangesup1 = new Predicate(StructuralConstants.RANGESUP + "1", false, tProp1, tClass1);
// // predicate rangesup2: Prop2 x Class2;
// Predicate rangesup2 = new Predicate(StructuralConstants.RANGESUP + "2", false, tProp2, tClass2);
//
// // disjointness between property ranges and concept
// // predicate rangedis1: Prop1 x Class1;
// Predicate rangedis1 = new Predicate(StructuralConstants.RANGEDIS + "1", false, tProp1, tClass1);
// // predicate rangedis2: Prop2 x Class2;
// Predicate rangedis2 = new Predicate(StructuralConstants.RANGEDIS + "2", false, tProp2, tClass2);
//
// // predicate cmap_confidence: Class1 x Class2 x Double;
// PredicateDouble cmap_confidence = new PredicateDouble(StructuralConstants.CMAP_CONFIDENCE, false, tClass1, tClass2);
// // predicate pmap_confidence: Prop1 x Prop2 x Double;
// PredicateDouble pmap_confidence = new PredicateDouble(StructuralConstants.PMAP_CONFIDENCE, false, tProp1, tProp2);
//
// // predicate class1: Class1
// Predicate class1 = new Predicate(StructuralConstants.CLASS + "1", false, tClass1);
// // predicate class2: Class2
// Predicate class2 = new Predicate(StructuralConstants.CLASS + "2", false, tClass2);
//
// // predicate prop1: Prop1
// Predicate prop1 = new Predicate(StructuralConstants.PROP + "1", false, tProp1);
// // predicate prop2: Prop2
// Predicate prop2 = new Predicate(StructuralConstants.PROP + "2", false, tProp2);
//
// // Set ground values predicates
// tClass1.setGroundValuesPredicate(class1);
// tClass2.setGroundValuesPredicate(class2);
// tProp1.setGroundValuesPredicate(prop1);
// tProp2.setGroundValuesPredicate(prop2);
//
// // WEIGHTS
// // weight w_c_stab: Double-;
// //Weight w_c_stab = new Weight("wCStab", CODISettings.subsumptionStabilityWeight);
// // weight w_pc_sub_domain_stab: Double-;
// //Weight w_pc_sub_domain_stab = new Weight("wPcSubDomainStab", CODISettings.domainStabilityWeight);
// // weight w_pc_sub_range_stab: Double-;
// //Weight w_pc_sub_range_stab = new Weight("wPcSubRangeStab", CODISettings.rangeStabilityWeight);
//
// // Variables
// VariableDouble cconf = new VariableDouble("cconf");
// VariableDouble cconf2 = new VariableDouble("cconf2");
// VariableType c1 = new VariableType("c1", tClass1);
// VariableType b1 = new VariableType("b1", tClass1);
// VariableType c2 = new VariableType("c2", tClass2);
// VariableType b2 = new VariableType("b2", tClass2);
// VariableType p1 = new VariableType("p1", tProp1);
// VariableType p2 = new VariableType("p2", tProp2);
//
// // a-priori confidence weights for concept correspondences
// // factor: for Class1 c1, Class2 c2, Double cconf
// // if cmap_confidence(c1, c2, cconf)
// // add [cmap(c1, c2)] * cconf;
//
// FormulaObjective lexicalWeightsConcepts = new FormulaObjective();
// lexicalWeightsConcepts.setName("lexicalWeightsConcepts");
// lexicalWeightsConcepts.setForVariables(c1, c2);
// lexicalWeightsConcepts.setIfExpressions(new PredicateExpression(true, cmap_confidence, c1, c2, cconf));
// lexicalWeightsConcepts.setObjectiveExpression(new PredicateExpression(true, cmap, c1, c2));
// lexicalWeightsConcepts.setDoubleVariable(cconf);
// model.addFormula(lexicalWeightsConcepts);
//
// // a-priori confidence weights for property correspondences
// // factor: for Prop1 p1, Prop2 p2, Double pconf
// // if pmap_confidence(p1, p2, pconf)
// // add [pmap(p1, p2)] * pconf;
// FormulaObjective lexicalWeightsProperties = new FormulaObjective();
// lexicalWeightsProperties.setName("lexicalWeightsProperties");
// lexicalWeightsProperties.setForVariables(p1, p2);
// lexicalWeightsProperties.setIfExpressions(new PredicateExpression(true, pmap_confidence, p1, p2, cconf));
// lexicalWeightsProperties.setObjectiveExpression(new PredicateExpression(true, pmap, p1, p2));
// lexicalWeightsProperties.setDoubleVariable(cconf);
// model.addFormula(lexicalWeightsProperties);
//
// if(CODISettings.functionalOneToOneConstraint) {
// // make alignment one-to-one and functional for concept correspondences
// // factor: for Class1 c1
// // if class1(c1):
// // |Class2 c2: cmap(c1,c2)| <= 1;
// FormulaCardinality conceptCard1 = new FormulaCardinality();
// conceptCard1.setName("conceptCard1");
// conceptCard1.setIfExpressions(new PredicateExpression(true, class1, c1), new PredicateExpression(true, class2, c2));
// conceptCard1.setForVariables(c1, c2);
// conceptCard1.setOverVariables(c2);
// conceptCard1.setRestrictions(new PredicateExpression(true, cmap, c1, c2));
// conceptCard1.setCardinality(1);
// model.addFormula(conceptCard1);
//
// // factor: for Class2 c2
// // if class2(c2):
// // |Class1 c1: cmap(c1,c2)| <= 1;
// FormulaCardinality conceptCard2 = new FormulaCardinality();
// conceptCard2.setName("conceptCard2");
// conceptCard2.setIfExpressions(new PredicateExpression(true, class1, c1), new PredicateExpression(true, class2, c2));
// conceptCard2.setForVariables(c1, c2);
// conceptCard2.setOverVariables(c1);
// conceptCard2.setRestrictions(new PredicateExpression(true, cmap, c1, c2));
// conceptCard2.setCardinality(1);
// model.addFormula(conceptCard2);
//
// // make alignment one-to-one and functional for property correspondences
// // factor: for Prop1 p1
// // if prop1(p1):
// // |Prop2 p2: pmap(p1,p2)| <= 1;
// FormulaCardinality propCard1 = new FormulaCardinality();
// propCard1.setName("propCard1");
// propCard1.setIfExpressions(new PredicateExpression(true, prop1, p1), new PredicateExpression(true, prop2, p2));
// propCard1.setForVariables(p1, p2);
// propCard1.setOverVariables(p2);
// propCard1.setRestrictions(new PredicateExpression(true, pmap, p1, p2));
// propCard1.setCardinality(1);
// model.addFormula(propCard1);
//
// // factor: for Prop2 p2
// // if prop2(p2):
// // |Prop1 p1: pmap(p1,p2)| <= 1;
// FormulaCardinality propCard2 = new FormulaCardinality();
// propCard2.setName("propCard2");
// propCard2.setIfExpressions(new PredicateExpression(true, prop1, p1), new PredicateExpression(true, prop2, p2));
// propCard2.setForVariables(p1, p2);
// propCard2.setOverVariables(p1);
// propCard2.setRestrictions(new PredicateExpression(true, pmap, p1, p2));
// propCard2.setCardinality(1);
// model.addFormula(propCard2);
//
// }
//
// // ***** COHERENCE-CONSTRAINTS (hard) *****
//
// if(CODISettings.subsumptionCoherenceConstraint) {
// // constraints between concept correspondences
//
// // factor: for Class1 c1, Class1 b1, Class2 c2, Class2 b2
// // if subsumes1(c1, b1) & disjoint2(c2, b2) :
// // cmap(c1, c2) => !cmap(b1, b2);
// FormulaHard subsumptionCoherence1 = new FormulaHard();
// subsumptionCoherence1.setName("subsumptionCoherence1");
// subsumptionCoherence1.setForVariables(c1, b1, c2, b2);
// subsumptionCoherence1.setIfExpressions(new PredicateExpression(true, subsumes1, c1, b1), new PredicateExpression(true, disjoint2, c2, b2));
// subsumptionCoherence1.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, cmap, b1, b2));
// model.addFormula(subsumptionCoherence1);
//
// // factor: for Class1 c1, Class1 b1, Class2 c2, Class2 b2
// // if subsumes2(c2, b2) & disjoint1(c1, b1):
// // cmap(c1, c2) => !cmap(b1, b2);
// FormulaHard subsumptionCoherence2 = new FormulaHard();
// subsumptionCoherence2.setName("subsumptionCoherence2");
// subsumptionCoherence2.setForVariables(c1, b1, c2, b2);
// subsumptionCoherence2.setIfExpressions(new PredicateExpression(true, subsumes2, c2, b2), new PredicateExpression(true, disjoint1, c1, b1));
// subsumptionCoherence2.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, cmap, b1, b2));
// model.addFormula(subsumptionCoherence2);
// }
// if(CODISettings.domainCoherenceConstraint) {
// // constraints between concept and property correspondences via domains
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if domainsub1(a1, b1) & domaindis2(a2, b2):
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard domainCoherence1 = new FormulaHard();
// domainCoherence1.setName("domainCoherence1");
// domainCoherence1.setForVariables(c1, p1, c2, p2);
// domainCoherence1.setIfExpressions(new PredicateExpression(true, domainsub1, p1, c1), new PredicateExpression(true, domaindis2, p2, c2));
// domainCoherence1.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(domainCoherence1);
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if domainsup1(a1, b1) & domaindis2(a2, b2):
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard domainCoherence2 = new FormulaHard();
// domainCoherence2.setName("domainCoherence2");
// domainCoherence2.setForVariables(c1, p1, c2, p2);
// domainCoherence2.setIfExpressions(new PredicateExpression(true, domainsup1, p1, c1), new PredicateExpression(true, domaindis2, p2, c2));
// domainCoherence2.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(domainCoherence2);
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if domainsub2(a2, b2) & domaindis1(a1, b1) :
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard domainCoherence3 = new FormulaHard();
// domainCoherence3.setName("domainCoherence3");
// domainCoherence3.setForVariables(c1, p1, c2, p2);
// domainCoherence3.setIfExpressions(new PredicateExpression(true, domainsub2, p2, c2), new PredicateExpression(true, domaindis1, p1, c1));
// domainCoherence3.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(domainCoherence3);
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if domainsup2(a2, b2) & domaindis1(a1, b1) :
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard domainCoherence4 = new FormulaHard();
// domainCoherence4.setName("domainCoherence4");
// domainCoherence4.setForVariables(c1, p1, c2, p2);
// domainCoherence4.setIfExpressions(new PredicateExpression(true, domainsup2, p2, c2), new PredicateExpression(true, domaindis1, p1, c1));
// domainCoherence4.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(domainCoherence4);
// }
// if(CODISettings.rangeCoherenceConstraint) {
// // constraints between concept and property correspondences via ranges
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if rangesub1(a1, b1) & rangedis2(a2, b2):
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard rangeCoherence1 = new FormulaHard();
// rangeCoherence1.setName("rangeCoherence1");
// rangeCoherence1.setForVariables(c1, p1, c2, p2);
// rangeCoherence1.setIfExpressions(new PredicateExpression(true, rangesub1, p1, c1), new PredicateExpression(true, rangedis2, p2, c2));
// rangeCoherence1.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(rangeCoherence1);
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if rangesup1(a1, b1) & rangedis2(a2, b2):
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard rangeCoherence2 = new FormulaHard();
// rangeCoherence2.setName("rangeCoherence2");
// rangeCoherence2.setForVariables(c1, p1, c2, p2);
// rangeCoherence2.setIfExpressions(new PredicateExpression(true, rangesup1, p1, c1), new PredicateExpression(true, rangedis2, p2, c2));
// rangeCoherence2.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(rangeCoherence2);
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if rangesub2(a2, b2) & rangedis1(a1, b1) :
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard rangeCoherence3 = new FormulaHard();
// rangeCoherence3.setName("rangeCoherence3");
// rangeCoherence3.setForVariables(c1, p1, c2, p2);
// rangeCoherence3.setIfExpressions(new PredicateExpression(true, rangesub2, p2, c2), new PredicateExpression(true, rangedis1, p1, c1));
// rangeCoherence3.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(rangeCoherence3);
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if rangesup2(a2, b2) & rangedis1(a1, b1):
// // pmap(a1, a2) => !cmap(b1, b2);
// FormulaHard rangeCoherence4 = new FormulaHard();
// rangeCoherence4.setName("rangeCoherence4");
// rangeCoherence4.setForVariables(c1, p1, c2, p2);
// rangeCoherence4.setIfExpressions(new PredicateExpression(true, rangesup2, p2, c2), new PredicateExpression(true, rangedis1, p1, c1));
// rangeCoherence4.setRestrictions(new PredicateExpression(false, cmap, c1, c2), new PredicateExpression(false, pmap, p1, p2));
// model.addFormula(rangeCoherence4);
// }
//
// // ****** STABILITY-CONSTRAINTS (soft) ******
//
// // constraints between concept correspondences
//
// // factor: for Class1 a1, Class1 b1, Class2 a2, Class2 b2
// // if subsumes1(a1, b1) & subsumes2(a2, b2)
// // add [cmap(a1, a2) & cmap(b1, b2)] * w_c_stab;
//
// if(CODISettings.subsumptionStabilityConstraint) {
// /*FormulaSoft subsumesSoft1 = new FormulaSoft();
// subsumesSoft1.setName("subsumesSoft1");
// subsumesSoft1.setForVariables(c1, b1, c2, b2);
// subsumesSoft1.setIfExpressions(new PredicateExpression(true, subsumes1, c1, b1), new PredicateExpression(true, subsumes2, c2, b2), new PredicateExpression(true, cmap_confidence, c1, c2, cconf), new PredicateExpression(true, cmap_confidence, b1, b2, cconf2), new EqualVariableExpression(c1, b1, false),
// new EqualVariableExpression(c2, b2, false));
// subsumesSoft1.setRestrictions(new PredicateExpression(true, cmap, c1, c2), new PredicateExpression(true, cmap, b1, b2));
// subsumesSoft1.setWeight(CODISettings.subsumptionStabilityWeight);
// subsumesSoft1.setConjunction();
// model.addFormula(subsumesSoft1);
// */
// FormulaSoft subsumesSoft1 = new FormulaSoft();
// subsumesSoft1.setName("subsumesSoft1");
// subsumesSoft1.setForVariables(c1, b1, c2, b2);
// subsumesSoft1.setIfExpressions(
// new PredicateExpression(true, subsumes1, c1, b1),
// new PredicateExpression(false, subsumes2, c2, b2),
// new PredicateExpression(true, cmap_confidence, c1,c2,cconf),
// new PredicateExpression(true, cmap_confidence, b1,b2,cconf2),
// new EqualVariableExpression(c1, b1, false),
// new EqualVariableExpression(c2, b2, false)
// );
// subsumesSoft1.setRestrictions(
// new PredicateExpression(false, cmap, c1, c2),
// new PredicateExpression(false, cmap, b1, b2)
// );
// subsumesSoft1.setWeight(CODISettings.subsumptionStabilityWeight);
// model.addFormula(subsumesSoft1);
//
// FormulaSoft subsumesSoft2 = new FormulaSoft();
// subsumesSoft2.setName("subsumesSoft2");
// subsumesSoft2.setForVariables(c1, b1, c2, b2);
// subsumesSoft2.setIfExpressions(
// new PredicateExpression(false, subsumes1, c1, b1),
// new PredicateExpression(true, subsumes2, c2, b2),
// new PredicateExpression(true, cmap_confidence, c1,c2,cconf),
// new PredicateExpression(true, cmap_confidence, b1,b2,cconf2),
// new EqualVariableExpression(c1, b1, false),
// new EqualVariableExpression(c2, b2, false)
// );
// subsumesSoft2.setRestrictions(
// new PredicateExpression(false, cmap, c1, c2),
// new PredicateExpression(false, cmap, b1, b2)
// );
// subsumesSoft2.setWeight(CODISettings.subsumptionStabilityWeight);
// //subsumesSoft2.setConjunction();
// model.addFormula(subsumesSoft2);
//
//
// }
//
// // constraints between property and concept correspondences via domain
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if !domainsub1(a1, b1) & domainsub2(a2, b2)
// // add [pmap(a1, a2) & cmap(b1, b2)] * w_pc_sub_domain_stab;
// //
// if(CODISettings.domainStabilityConstraint) {
// /*
// FormulaSoft domainSoft1 = new FormulaSoft();
// domainSoft1.setName("domainSoft1");
// domainSoft1.setForVariables(c1, p1, c2, p2);
// domainSoft1.setIfExpressions(new PredicateExpression(true, domainsub1, p1, c1), new PredicateExpression(true, domainsub2, p2, c2), new PredicateExpression(true, cmap_confidence, c1, c2, cconf), new PredicateExpression(true, pmap_confidence, p1, p2, cconf2));
// domainSoft1.setRestrictions(new PredicateExpression(true, pmap, p1, p2), new PredicateExpression(true, cmap, c1, c2));
// domainSoft1.setWeight(CODISettings.domainStabilityWeight);
// domainSoft1.setConjunction();
// model.addFormula(domainSoft1);
// */
//
// FormulaSoft domainSoft1 = new FormulaSoft();
// domainSoft1.setName("domainSoft1");
// domainSoft1.setForVariables(c1, p1, c2, p2);
// domainSoft1.setIfExpressions(
// new PredicateExpression(true, domainsub1, p1, c1),
// new PredicateExpression(false, domainsub2, p2, c2),
// new PredicateExpression(true, cmap_confidence, c1,c2,cconf),
// new PredicateExpression(true, pmap_confidence, p1,p2,cconf2)
// );
// domainSoft1.setRestrictions(
// new PredicateExpression(false, pmap, p1, p2),
// new PredicateExpression(false, cmap, c1, c2)
// );
// domainSoft1.setWeight(CODISettings.domainStabilityWeight);
// //domainSoft1.setConjunction();
// model.addFormula(domainSoft1);
// FormulaSoft domainSoft2 = new FormulaSoft();
// domainSoft2.setName("domainSoft2");
// domainSoft2.setForVariables(c1, p1, c2, p2);
// domainSoft2.setIfExpressions(
// new PredicateExpression(false, domainsub1, p1, c1),
// new PredicateExpression(true, domainsub2, p2, c2) ,
// new PredicateExpression(true, cmap_confidence, c1,c2,cconf),
// new PredicateExpression(true, pmap_confidence, p1,p2,cconf2)
// );
// domainSoft2.setRestrictions(
// new PredicateExpression(false, pmap, p1, p2),
// new PredicateExpression(false, cmap, c1, c2)
// );
// domainSoft2.setWeight(CODISettings.domainStabilityWeight);
// //domainSoft2.setConjunction();
// model.addFormula(domainSoft2);
//
//
// }
//
// // constraints between property and concept correspondences via range
//
// // factor: for Prop1 a1, Class1 b1, Prop2 a2, Class2 b2
// // if !rangesub1(a1, b1) & rangesub2(a2, b2)
// // add [pmap(a1, a2) & cmap(b1, b2)] * w_pc_sub_range_stab;
//
// if(CODISettings.rangeStabilityConstraint) {
// /*FormulaSoft rangeSoft1 = new FormulaSoft();
// rangeSoft1.setName("rangeSoft1");
// rangeSoft1.setForVariables(c1, p1, c2, p2);
// rangeSoft1.setIfExpressions(new PredicateExpression(true, rangesub1, p1, c1), new PredicateExpression(true, rangesub2, p2, c2), new PredicateExpression(true, cmap_confidence, c1, c2, cconf), new PredicateExpression(true, pmap_confidence, p1, p2, cconf2));
// rangeSoft1.setRestrictions(new PredicateExpression(true, pmap, p1, p2), new PredicateExpression(true, cmap, c1, c2));
// rangeSoft1.setWeight(CODISettings.rangeStabilityWeight);
// rangeSoft1.setConjunction();
// model.addFormula(rangeSoft1);
// */
//
// FormulaSoft rangeSoft1 = new FormulaSoft();
// rangeSoft1.setName("rangeSoft1");
// rangeSoft1.setForVariables(c1, p1, c2, p2);
// rangeSoft1.setIfExpressions(
// new PredicateExpression(true, rangesub1, p1, c1),
// new PredicateExpression(false, rangesub2, p2, c2),
// new PredicateExpression(true, cmap_confidence, c1,c2,cconf),
// new PredicateExpression(true, pmap_confidence, p1,p2,cconf2)
// );
// rangeSoft1.setRestrictions(
// new PredicateExpression(false, pmap, p1, p2),
// new PredicateExpression(false, cmap, c1, c2)
// );
// rangeSoft1.setWeight(CODISettings.domainStabilityWeight);
// model.addFormula(rangeSoft1);
// FormulaSoft rangeSoft2 = new FormulaSoft();
// rangeSoft2.setName("rangeSoft2");
// rangeSoft2.setForVariables(c1, p1, c2, p2);
// rangeSoft2.setIfExpressions(
// new PredicateExpression(false, rangesub1, p1, c1),
// new PredicateExpression(true, rangesub2, p2, c2),
// new PredicateExpression(true, cmap_confidence, c1,c2,cconf),
// new PredicateExpression(true, pmap_confidence, p1,p2,cconf2)
// );
// rangeSoft2.setRestrictions(
// new PredicateExpression(false, pmap, p1, p2),
// new PredicateExpression(false, cmap, c1, c2)
// );
// rangeSoft2.setWeight(CODISettings.domainStabilityWeight);
// model.addFormula(rangeSoft2);
// }
//
// } catch(ParseException e) {
// e.printStackTrace();
// }
//
// //System.out.println(model);
//
// return model;
// }
//
// /**
// * Test main.
// *
// * @param args
// */
// public static void main(String[] args) {
// ModelGenerator g = new ModelGenerator();
// Model m = g.generateModel();
// System.out.println(m);
// System.out.println(m.getAllObservedPredicates());
// }
//
 }
